﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <title>RTMP src方式嵌入播放</title>
    <style type="text/css">
        body{
            margin: 0px;
            padding: 0px;
        }
    </style>
</head>
<body>
<div style="width: 940px; height: 452px; margin-left: auto;margin-right: auto">
    <script type="text/javascript" src="http://jackzhang1204.github.io/sewise/sewise_player/player/sewise.player.min.js"></script>
    <script type="text/javascript">
        function getParams () {
            var url = location.search; //获取url中"?"符后的字串
            console.log(url);
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1);
                strs = str.split("&");
                for(var i = 0; i < strs.length; i ++) {
                    theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }
        var channel = getParams();
        var $activityid = channel['activityid'];
        var $username = channel['username'];
        var $pwd = channel['pwd'];
        var $token = channel['token'];
        var url = 'fsdfdsfs';
        //判断检测是否合适
        console.warn(channel);
        console.warn(location.hash);
        console.warn(location.host);
        console.warn(location.pathname);
        console.warn(location.href);
        console.table("rtmp://rtmp.uc.anyrtc.io/live/"+$activityid+'?username='+$username+'pwd='+$pwd+'token='+$token);
        SewisePlayer.setup({
            server: "live",
            type: "rtmp",
//            streamurl: "rtmp://121.43.63.240/live/"+$activityid+'?username='+$username+'&pwd='+$pwd+'&token='+$token,
            streamurl: "rtmp://tinywan.amai8.com/live/4001492050970",
            //streamurl: "rtmp://121.43.63.240/live/S0000_8?username=tinywan&pwd=123456&token=123456",
            //streamurl: "rtmp://rtmp.uc.anyrtc.io/live/"+channel['activityid'],
            autostart: "true",
            buffer: "5",
            title: "RTMP src path",
            lang: "zh_CN",
            claritybutton: "disable",   //是否自动影藏导航栏
            skin: "liveWhite",
        });
    </script>
</div>

<div style="padding: 20px;float: left;margin-left: auto;margin-right: auto">
    <h1>直播RTMP权限地址检测</h1>
    <hr/>
    <h2>分发服务器</h2><p></p>
    <font color="green" size="4">【SewisePlayer OK】当前播放：rtmp://120.26.206.180/live/test_8【VLC可以】</font>【待解决】<p></p>
    <font color="green" size="4">【SewisePlayer OK】当前播放：rtmp://120.26.206.180/live/test_8?username=tinywan&pwd=123456&token=123456【VLC可以】</font><p></p>
    <hr/>
    <h2>直播节点服务器</h2><p></p>
    <font color="red">【SewisePlayer ERROR】开启权限未携带参数：rtmp://121.43.63.240/live/S0000_8【VLC 错误!!!!】</font><p></p>
    <font color="red">【SewisePlayer ERROR】开启权限携带不合法参数：rtmp://121.43.63.240/live/S0000_8?username=tinywan&pwd=1234567890&token=123456【VLC 错误!!!!】</font><p></p>
    <font color="green" size="4">【SewisePlayer OK】开启权限携带合法参数：rtmp://121.43.63.240/live/S0000_8?username=tinywan&pwd=123456&token=123456【VLC】</font><p></p>
    <hr/>
</div>
</body>
</html>